package com.lv.service.model

import com.lv.common.network.model.DataResult
import com.lv.common.network.support.serverData
import com.lv.service.net.ADStatisticsReqBody
import com.lv.service.net.BindPhoneReqBody
import com.lv.service.net.BrandHotBody
import com.lv.service.net.ClientHFRReqBody
import com.lv.service.net.CollectOrAttentionBody
import com.lv.service.net.CompanyReqBody
import com.lv.service.net.KeyLoginReqBody
import com.lv.service.net.LoginByCodeReqBody
import com.lv.service.net.LoginByPassWordReqBody
import com.lv.service.net.PageBrandBody
import com.lv.service.net.PageCategoryBody
import com.lv.service.net.PageIdBody
import com.lv.service.net.PageNameIdBody
import com.lv.service.net.RegistUserReqBody
import com.lv.service.net.SearchPageBody
import com.lv.service.net.SendCodeBody
import com.lv.service.net.ServiceService
import com.lv.service.net.ThreedLoginReqBody
import com.lv.service.net.UserDeleteReqBody
import com.lv.service.net.VerifyCodeBody
import com.lv.service.net.VerifyPhoneReqBody
import com.lv.service.network.BaseYgxRsp
import okhttp3.MultipartBody
import okhttp3.RequestBody

/**
 * 创建者：ygx
 * 创建日期：2021/9/17 11:28 PM
 * 描述：TODO
 */
class ServiceRepo(private val service: ServiceService) : IServiceResource {
    override suspend fun login(body: LoginByPassWordReqBody): DataResult<BaseYgxRsp> {
        return service.login(body).serverData()
    }

    override suspend fun loginByCode(body: LoginByCodeReqBody): DataResult<BaseYgxRsp> {
        return service.loginByCode(body).serverData()
    }

    override suspend fun latestUser(
    ): DataResult<BaseYgxRsp> {
        return service.latestUser().serverData()
    }

    /**
     * 检查更新
     */
    override suspend fun findVersionUpdate(): DataResult<BaseYgxRsp> {
        return service.findVersionUpdate().serverData()
    }

    override suspend fun findPros(
        map: Map<String, String>
    ): DataResult<BaseYgxRsp> {
        return service.findPros(map).serverData()
    }

    /**
     * 注册
     */
    override suspend fun registUser(body: RegistUserReqBody): DataResult<BaseYgxRsp> {
        return service.registUser(body).serverData()
    }

    /**
     * 一键登录
     */
    override suspend fun keyToLand(reqBody: KeyLoginReqBody): DataResult<BaseYgxRsp> {
        return service.keyToLand(reqBody).serverData()
    }

    /**
     * 三方登录
     */
    override suspend fun threeLanding(reqBody: ThreedLoginReqBody): DataResult<BaseYgxRsp> {
        return service.threeLanding(reqBody).serverData()
    }

    /**
     * 绑定手机号
     */
    override suspend fun bindingUser(reqBody: BindPhoneReqBody): DataResult<BaseYgxRsp> {
        return service.bindingUser(reqBody).serverData()
    }


    /**
     * 验证手机号
     */
    override suspend fun verifyPhone(body: VerifyPhoneReqBody): DataResult<BaseYgxRsp> {
        return service.verifyPhone(body).serverData()
    }

    /**
     * 完善信息
     */
    override suspend fun updateUser(map: Map<String, RequestBody>): DataResult<BaseYgxRsp> {
        return service.updateUser(map).serverData()
    }

    /**
     * 发送短信验证
     */
    override suspend fun sendCode(
        body: SendCodeBody
    ): DataResult<BaseYgxRsp> {
        return service.sendCode(body).serverData()
    }

    /**
     * 验证验证码
     */
    override suspend fun verifyCode(
        body: VerifyCodeBody
    ): DataResult<BaseYgxRsp> {
        return service.verifyCode(body).serverData()
    }

    /**
     *  广告统计
     */
    override suspend fun saveAdStatistics(body: ADStatisticsReqBody): DataResult<BaseYgxRsp> {
        return service.saveAdStatistics(body).serverData()
    }

    /**
     * 意见反馈
     */
    override suspend fun feedback(text: String): DataResult<BaseYgxRsp> {
        return service.feedback(text).serverData()
    }

    /**
     * 修改个人信息
     */
    override suspend fun updateMyLogo(
        map: Map<String, RequestBody>, part: List<MultipartBody.Part>
    ): DataResult<BaseYgxRsp> {
        return service.updateMyLogo(map, part).serverData()
    }

    /**
     * 修改个人信息
     */
    override suspend fun updateMyMessage(body: Map<String, RequestBody>): DataResult<BaseYgxRsp> {
        return service.updateMyMessage(body).serverData()
    }

    /**
     * 注销个人信息
     */
    override suspend fun deleteUser(body: UserDeleteReqBody): DataResult<BaseYgxRsp> {
        return service.deleteUser(body).serverData()
    }

    /**
     * 发送短信验证-修改公司
     */
    override suspend fun sendCodeCom(body: SendCodeBody): DataResult<BaseYgxRsp> {
        return service.sendCodeCom(body).serverData()
    }

    /**
     * 验证验证码-修改公司
     */
    override suspend fun verifyCodeCom(body: VerifyCodeBody): DataResult<BaseYgxRsp> {
        return service.verifyCodeCom(body).serverData()
    }

    /**
     * 修改个人信息-业务员修改公司
     */
    override suspend fun updatePasswordOrPhone(body: CompanyReqBody): DataResult<BaseYgxRsp> {
        return service.updatePasswordOrPhone(body).serverData()
    }


    /**
     * 查找个数
     */
    override suspend fun findCount(
        map: Map<String, String>
    ): DataResult<BaseYgxRsp> {
        return service.findCount(map).serverData()
    }


    /**
     * 查找单个期数
     */
    override suspend fun findOnePdAndCa(map: Map<String, String>): DataResult<BaseYgxRsp> {
        return service.findOnePdAndCa(map).serverData()
    }

    /**
     *  查看小程序或进件信息
     */
    override suspend fun findOneSubmit(map: Map<String, String>): DataResult<BaseYgxRsp> {
        return service.findOneSubmit(map).serverData()
    }

    /**
     *  亨富然基础信息
     */
    override suspend fun findhengPros(map: Map<String, String>): DataResult<BaseYgxRsp> {
        return service.findhengPros(map).serverData()
    }

    /**
     * 亨富然开户
     */
    override suspend fun saveHengCompany(body: ClientHFRReqBody): DataResult<BaseYgxRsp> {
        return service.saveHengCompany(body).serverData()
    }

    /**
     * 首页头
     */
    override suspend fun homePage(map: Map<String, String>): DataResult<BaseYgxRsp> {
        return service.homePage(map).serverData()
    }

    /**
     * 首页尾
     */
    override suspend fun bottomPage(
        page: Int, pageSize: Int, map: Map<String, String>
    ): DataResult<BaseYgxRsp> {
        return service.bottomPage(page, pageSize, map).serverData()
    }

    /**
     * 商品详情
     */
    override suspend fun findOneGoods(spuid: String): DataResult<BaseYgxRsp> {
        return service.findOneGoods(spuid).serverData()
    }

    /**
     * 商品详情底部推荐
     */
    override suspend fun findGoodsbotton(
        page: Int, pageSize: Int, map: Map<String, String>
    ): DataResult<BaseYgxRsp> {
        return service.findGoodsbotton(page, pageSize, map).serverData()
    }

    /**
     * 收藏商品/关注公司
     */
    override suspend fun collectOrAttention(body: CollectOrAttentionBody): DataResult<BaseYgxRsp> {
        return service.collectOrAttention(body).serverData()
    }

    /**
     * 商品详情页推荐商品和相似商品
     */
    override suspend fun findGoodsRemark(map: Map<String, String>): DataResult<BaseYgxRsp> {
        return service.findGoodsRemark(map).serverData()
    }

    /**
     * 公司详情
     */
    override suspend fun findOneCompany(map: Map<String, String>): DataResult<BaseYgxRsp> {
        return service.findOneCompany(map).serverData()
    }

    /**
     * 详情页访问记录
     */
    override suspend fun findCompanyAccess(map: Map<String, String>): DataResult<BaseYgxRsp> {
        return service.findCompanyAccess(map).serverData()
    }

    /**
     * 公司产品
     */
    override suspend fun companyGoods(
        page: Int, pageSize: Int, map: Map<String, String>
    ): DataResult<BaseYgxRsp> {
        return service.companyGoods(page, pageSize, map).serverData()
    }

    /**
     * 主推商品
     */
    override suspend fun promoteGoods(
        page: Int, pageSize: Int, map: Map<String, String>
    ): DataResult<BaseYgxRsp> {
        return service.promoteGoods(page, pageSize, map).serverData()
    }

    /**
     * 店铺产品页
     */
    override suspend fun CompanyDetails(
        page: Int, pageSize: Int, map: Map<String, String>
    ): DataResult<BaseYgxRsp> {
        return service.CompanyDetails(page, pageSize, map).serverData()
    }

    /**
     * 搜索引导页
     */
    override suspend fun searchPagetally(
        page: Int, pageSize: Int, map: Map<String, String>
    ): DataResult<BaseYgxRsp> {
        return service.searchPagetally(page, pageSize, map).serverData()
    }

    /**
     * 搜索结果页
     */
    override suspend fun searchPage(body: SearchPageBody): DataResult<BaseYgxRsp> {
        return service.searchPage(body).serverData()
    }


    /**
     * 特惠顶部
     */
    override suspend fun specialOfferTop(): DataResult<BaseYgxRsp> {
        return service.specialOfferTop().serverData()
    }

    /**
     * 特惠
     */
    override suspend fun specialOffer(body: PageCategoryBody): DataResult<BaseYgxRsp> {
        return service.specialOffer(body).serverData()
    }

    /**
     * 新公司
     */
    override suspend fun newCompany(page: Int, pageSize: Int): DataResult<BaseYgxRsp> {
        return service.newCompany(page, pageSize).serverData()
    }

    /**
     * 查询banner
     */
    override suspend fun findAllBanner(code: String): DataResult<BaseYgxRsp> {
        return service.findAllBanner(code).serverData()
    }

    /**
     * 品牌工厂顶部
     */
    override suspend fun brandFacTop(body: PageIdBody): DataResult<BaseYgxRsp> {
        return service.brandFacTop(body).serverData()
    }

    /**
     * 品牌工厂
     */
    override suspend fun brandFac(body: PageBrandBody): DataResult<BaseYgxRsp> {
        return service.brandFac(body).serverData()
    }

    /**
     * 必找工厂
     */
    override suspend fun mustFac(body: PageBrandBody): DataResult<BaseYgxRsp> {
        return service.mustFac(body).serverData()
    }

    /**
     * 本地工厂
     */
    override suspend fun localFac(body: PageBrandBody): DataResult<BaseYgxRsp> {
        return service.localFac(body).serverData()
    }

    /**
     * 批发好货
     */
    override suspend fun saleByBulk(body: PageNameIdBody): DataResult<BaseYgxRsp> {
        return service.saleByBulk(body).serverData()
    }

    /**
     * 品牌热卖
     */
    override suspend fun brandHot(body: BrandHotBody): DataResult<BaseYgxRsp> {
        return service.brandHot(body).serverData()
    }

    /**
     * 品牌热卖查看更多
     */
    override suspend fun manybrand(body: BrandHotBody): DataResult<BaseYgxRsp> {
        return service.manybrand(body).serverData()
    }

    /**
     * 附近商品
     */
    override suspend fun localGoods(body: PageBrandBody): DataResult<BaseYgxRsp> {
        return service.localGoods(body).serverData()
    }

    /**
     * 热销 顶部
     */
    override suspend fun salehotTop(): DataResult<BaseYgxRsp> {
        return service.salehotTop().serverData()
    }

    /**
     * 热销
     */
    override suspend fun salehot(body: PageCategoryBody): DataResult<BaseYgxRsp> {
        return service.salehot(body).serverData()
    }
}